#!/usr/bin/env python
# FTC Planner configuration

from dynamic_reconfigure.parameter_generator_catkin import ParameterGenerator, double_t, int_t, bool_t

gen = ParameterGenerator()

gen.add("vfh_sections_number", int_t, 0, "Number of sector in the histogram.", 72, 8, 360)

gen.add("vhf_detection_range", double_t, 0, "Obstacle sensitivity distance.", 15)

gen.add("increase_rate", double_t, 0, "Magnitude gradient increase rate.", 0.5, 0, 30.0)

gen.add("goal_weight", int_t, 0, "Weigth of goal direction for the direction cost function.", 1, 0, 10)

gen.add("curr_direction_weight", int_t, 0, "Weigth of current direction for the direction cost function.", 1, 0, 10)

gen.add("prev_direction_weight", int_t, 0, "Weigth of previews direction for the direction cost function.", 1, 0, 10)

gen.add("smooth_length", int_t, 0, "Number of sectors considered in the smoothing.", 5, 1, 360)

gen.add("front_angle", int_t, 0, "Number of sectors that is considered in front of the robot.", 1, 1, 360)

gen.add("vfh_threshold", double_t, 0, "Threshold of VFH magnitude.", 160)

gen.add("wide_valley_threshold", int_t, 0, "Minimum number of sector of wide valley.", 12, 1, 360)

gen.add("very_narrow_valley_threshold", int_t, 0, "Minimum number of sector for a valid valley.", 6, 1, 359)

gen.add("max_vel_x_", double_t, 0, "The maximum x velocity for the robot in m/s.", 0.4, 0, 20.0)

gen.add("max_vel_th_", double_t, 0, "The absolute value of the maximum rotational velocity for the robot in rad/s.", 0.55, 0, 20.0)

gen.add("min_vel_th_", double_t, 0, "The absolute value of the minimum rotational velocity for the robot in rad/s.", -0.55, -20.0, 20.0)

gen.add("min_in_place_vel_th_", double_t, 0, "The absolute value of the minimum rotational velocity for the robot when it's stopped in rad/s.", 0.4, 0, 20.0)

gen.add("acc_lim_x_", double_t, 0, "The acceleration limit of the robot in the x direction.", 0.2, 0, 20.0)

gen.add("acc_lim_theta_", double_t, 0, "The acceleration limit of the robot for rotation.", 0.3, 0, 20.0)

gen.add("xy_goal_tolerance_", double_t, 0, "Maximal distance to the goal position.", 0.10, 0, 10.0)

gen.add("yaw_goal_tolerance_", double_t, 0, "Accuracy of the orientation to the goal orientation.", 0.1, 0, 3.14)

gen.add("local_planner_frequence", double_t, 0, "Need to set to the same value as the local planner frequence (controller frequence) in move base.", 5, 0, 100.0)

gen.add("ignore_global_plan_updates", bool_t, 0, "Don't follows global plan after enconter obstacle on the path.", True)

gen.add("restore_defaults",  bool_t, 0, "Retore to the default configuration", False)


exit(gen.generate("vfh_local_planner", "vfh_local_planner", "vfh_local_planner"))
